<?php

session_start();

 

if(!isset($_SESSION['admin']) && $_SESSION['admin']!=1){
    
    header('HTTP/1.1 500 Internal Server Error');
}


include('db.php');



$mall_list = Db::table('shops')->field('id,name,user_id')->where(['verification_status'=>1])->order('id desc')->select();


foreach ($mall_list as $k=>$v){
    
   $num = Db::table('products')->field('count(*) as num')->where(['user_id'=>$v['user_id']])->order('id desc')->find();
   
   if($num['num'] != 0) {
       
       $mall_list[$k]['num'] = $num;
       
   } else {
       
       unset($mall_list[$k]);
   }
}



 



include('./index.html');
?>